


<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

    <title>Introduction &#8212; CVX Users&#39; Guide</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/cloud.css" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noticia+Text:400,i,b,bi|Open+Sans:400,i,b,bi|Roboto+Mono:400,i,b,bi&amp;display=swap" type="text/css" />
    
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="_static/doctools.js"></script>
    <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

    
    
     
        <script src="_static/jquery.cookie.js"></script>
    

    
     
        <script src="_static/cloud.base.js"></script>
    

    
     
        <script src="_static/cloud.js"></script>
    

    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Installation" href="install.html" />
    <link rel="prev" title="CVX Users’ Guide" href="index.html" /> 
        <meta name="viewport" content="width=device-width, initial-scale=1">
  </head><body>
    <div class="relbar-top">
        
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="install.html" title="Installation"
             accesskey="N">next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="index.html" title="CVX Users’ Guide"
             accesskey="P">previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">CVX Users&#39; Guide</a> &#187;</li>

        <li class="nav-item nav-item-this"><a href="">Introduction</a></li> 
      </ul>
    </div>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="introduction">
<span id="id1"></span><h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this heading">¶</a></h1>
<section id="what-is-cvx">
<h2>What is CVX?<a class="headerlink" href="#what-is-cvx" title="Permalink to this heading">¶</a></h2>
<span class="target" id="index-0"></span><p id="index-1">CVX is a modeling system for constructing and solving
<a class="reference internal" href="#what-is-dcp"><span class="std std-ref">disciplined convex programs</span></a> (DCPs).
CVX supports a number of standard problem types, including linear and
quadratic programs (LPs/QPs), second-order cone programs (SOCPs), and
semidefinite programs (SDPs). CVX can also solve much more complex convex
optimization problems, including many involving nondifferentiable
functions, such as <span class="math notranslate nohighlight">\(\ell_1\)</span> norms. You can use CVX to conveniently
formulate and solve constrained norm minimization, entropy maximization,
determinant maximization, and many other convex programs. As of version
2.0, CVX also solves <a class="reference internal" href="#what-is-midcp"><span class="std std-ref">mixed integer disciplined convex programs</span></a> (MIDCPs)
as well, with an appropriate integer-capable solver.</p>
<p>To use CVX effectively, you need to know at least a bit about convex
optimization. For background on convex optimization, see the book
<a class="reference external" href="http://www.stanford.edu/~boyd/cvxbook">Convex Optimization</a> <a class="reference internal" href="credits.html#bv04" id="id2"><span>[BV04]</span></a> or the
<a class="reference external" href="http://www.stanford.edu/class/ee364a">Stanford course EE364A</a>.</p>
<p>CVX is implemented in <a class="reference external" href="http://mathworks.com">Matlab</a>, effectively
turning Matlab into an optimization modeling language. Model
specifications are constructed using common Matlab operations and
functions, and standard Matlab code can be freely mixed with these
specifications. This combination makes it simple to perform the
calculations needed to form optimization problems, or to process the
results obtained from their solution. For example, it is easy to compute
an optimal trade-off curve by forming and solving a family of
optimization problems by varying the constraints. As another example,
CVX can be used as a component of a larger system that uses convex
optimization, such as a branch and bound method, or an engineering
design framework.</p>
<p id="index-2">CVX provides special modes to simplify the construction of problems
from two specific problem classes. In
<a class="reference internal" href="sdp.html#sdp-mode"><span class="std std-ref">semidefinite programming (SDP) mode</span></a>,
CVX applies a matrix interpretation to the
inequality operator, so that linear matrix inequalities (LMIs) and
SDPs may be expressed in a more natural form. In
<a class="reference internal" href="gp.html#gp-mode"><span class="std std-ref">geometric programming (GP) mode</span></a>,
CVX accepts all of the special functions and
combination rules of geometric programming, including monomials,
posynomials, and generalized posynomials, and transforms such problems
into convex form so that they can be solved efficiently. For background
on geometric programming, see this
<a class="reference external" href="http://www.stanford.edu/~boyd/papers/gp_tutorial.html">tutorial paper</a> <a class="reference internal" href="credits.html#bkvh05" id="id3"><span>[BKVH05]</span></a>.</p>
<span class="target" id="index-3"></span><p id="index-4">Previous versions of CVX supported two free SQLP solvers,
<a class="reference external" href="http://sedumi.ie.lehigh.edu">SeDuMi</a> <a class="reference internal" href="credits.html#stu99" id="id4"><span>[Stu99]</span></a> and
<a class="reference external" href="http://www.math.nus.edu.sg/~mattohkc/sdpt3.html">SDPT3</a> <a class="reference internal" href="credits.html#ttt03" id="id5"><span>[TTT03]</span></a>. These
solvers are included with the CVX distribution. Starting with version 2.0,
CVX supports two <em>commercial</em> solvers as well,
<a class="reference external" href="http://gurobi.com">Gurobi</a> and <a class="reference external" href="http://mosek.com">MOSEK</a>. For
more information, see <a class="reference internal" href="solver.html#solvers"><span class="std std-ref">Solvers</span></a>.</p>
<p>The ability
to use CVX with commercial solvers is a capability that we have decided
to include under a new CVX Professional license model. Academic users will
be able to utilize these features at no charge, but commercial users will require
a paid CVX Professional license. For more details, see <a class="reference internal" href="#licensing"><span class="std std-ref">Licensing</span></a>.</p>
<section id="what-s-new">
<h3>What’s new?<a class="headerlink" href="#what-s-new" title="Permalink to this heading">¶</a></h3>
<p>Recent developments in solver technology are expanding CVX’s capability
to solve problems. In particular, the commercial solver Mosek has added
native support for the exponential cone; and this allows CVX to solve
problems involving logarithms, exponentials, and entropy functions
withouth reliance on its successive approximation heuristic.</p>
</section>
</section>
<section id="what-is-disciplined-convex-programming">
<span id="what-is-dcp"></span><span id="index-5"></span><h2>What is disciplined convex programming?<a class="headerlink" href="#what-is-disciplined-convex-programming" title="Permalink to this heading">¶</a></h2>
<p><em>Disciplined convex programming</em> is a methodology for constructing
convex optimization problems proposed by
Michael Grant, Stephen Boyd, and Yinyu Ye <a class="reference internal" href="credits.html#gby06" id="id6"><span>[GBY06]</span></a>, <a class="reference internal" href="credits.html#gra04" id="id7"><span>[Gra04]</span></a>.
It is meant to support the formulation and construction of optimization
problems that the user intends <em>from the outset</em> to be convex.</p>
<p id="index-6">Disciplined convex programming
imposes a set of conventions or rules, which we call <a class="reference internal" href="dcp.html#dcp"><span class="std std-ref">the DCP ruleset</span></a>.
Problems which adhere to the ruleset can be rapidly and automatically
verified as convex and converted to solvable form. Problems that violate
the ruleset are rejected—even when the problem is convex. That is not
to say that such problems cannot be solved using DCP; they just need to
be rewritten in a way that conforms to the DCP ruleset.</p>
<p>A detailed description of the DCP ruleset is given in <a class="reference internal" href="dcp.html#dcp"><span class="std std-ref">The DCP ruleset</span></a>.
It is extremely important for anyone who intends to
actively use CVX to understand it. The ruleset is simple to learn, and
is drawn from basic principles of convex analysis. In return for
accepting the restrictions imposed by the ruleset, we obtain
considerable benefits, such as automatic conversion of problems to
solvable form, and full support for nondifferentiable functions. In
practice, we have found that disciplined convex programs closely
resemble their natural mathematical forms.</p>
<section id="mixed-integer-problems">
<span id="what-is-midcp"></span><span id="index-7"></span><h3>Mixed integer problems<a class="headerlink" href="#mixed-integer-problems" title="Permalink to this heading">¶</a></h3>
<p>With version 2.0, CVX now supports <em>mixed integer</em> disciplined convex programs (MIDCPs).
A MIDCP is a model that obeys the same convexity rules as standard DCPs, except
that one or more of its variables is constrained to take on integral values. In other
words, if the integer constraints are removed, the result is a standard DCP.</p>
<p>Unlike a true DCP, a mixed integer problem is <em>not</em> convex. Finding the global optimum
requires the combination of a traditional convex optimization algorithm with an exhaustive
search such as a branch-and-bound algorithm. Some CVX solvers do not include this second
piece and therefore do not support MIDCPs; see <a class="reference internal" href="solver.html#solvers"><span class="std std-ref">Solvers</span></a> for more information.
What is more, even the best solvers cannot
guarantee that every moderately-sized MIDCP can be solved in a reasonable amount of time.</p>
<p>Mixed integer disciplined convex programming represents new territory for the
CVX modeling framework—and for the supporting solvers as well. While solvers
for mixed integer linear and quadratic programs (MILP/MIQP) are reasonably mature,
support for more general convex nonlinearities is a relatively new
development. We anticipate that MIDCP support will improve over time.</p>
</section>
</section>
<section id="what-cvx-is-not">
<h2>What CVX is <em>not</em><a class="headerlink" href="#what-cvx-is-not" title="Permalink to this heading">¶</a></h2>
<p>CVX is <em>not</em> meant to be a tool for checking if your problem is convex.
You need to know a bit about convex optimization to effectively use CVX;
otherwise you are the proverbial monkey at the typewriter, hoping to
(accidentally) type in a valid disciplined convex program. If you are
not certain that your problem is convex <em>before</em> you enter it into CVX,
you are using the tool improperly, and your efforts will likely fail.</p>
<p>CVX is <em>not</em> meant for very large problems, so if your problem is very
large (for example, a large image processing or machine learning problem), CVX is unlikely
to work well (or at all). For such problems you will likely need to
directly call a solver, or to develop your own methods, to get the
efficiency you need.</p>
<p>For such problems CVX can play an important role, however. Before
starting to develop a specialized large-scale method, you can use CVX to
solve scaled-down or simplified versions of the problem, to rapidly
experiment with exactly what problem you want to solve. For image
reconstruction, for example, you might use CVX to experiment with
different problem formulations on <span class="math notranslate nohighlight">\(50 \times 50\)</span> pixel images.</p>
<p>CVX <em>will</em> solve many medium and large scale problems, provided they
have exploitable structure (such as sparsity), and you avoid <code class="docutils literal notranslate"><span class="pre">for</span></code>
loops, which can be slow in Matlab. If you encounter difficulties in
solving large problem instances, consider posting your model to the
<a class="reference external" href="http://ask.cvxr.com">CVX Forum</a>; the CVX community
may be able to suggest an equivalent formulation that CVX
can process more efficiently.</p>
</section>
<section id="licensing">
<span id="index-8"></span><span id="id8"></span><h2>Licensing<a class="headerlink" href="#licensing" title="Permalink to this heading">¶</a></h2>
<p>CVX is free for use in both academic and commercial settings when paired with
a free solver—including the versions of SeDuMi and SDPT3 that are included with the
package.</p>
<p>With version 2.0, we have added the ability to connect CVX to <em>commercial</em> solvers as well.
This new functionality is released under a <em>CVX Professional</em> product tier
which we intend to license to commercial users for a fee, and offer to academic users
at no charge. The licensing structure is as follows:</p>
<ul class="simple">
<li><p><em>All users</em> are free to use the standard features of CVX <em>at no charge</em>.
This includes the ability to construct and solve any of the models
supported by the free solvers SeDuMi and SDPT3.</p></li>
<li><p><em>Commercial users</em> who wish to solve CVX models using Gurobi or MOSEK will
need to purchase a CVX Professional license. Please send an email to
<a class="reference external" href="mailto:sales&#37;&#52;&#48;cvxr&#46;com">CVX Research</a> for inquiries.
for an availability schedule and pricing details.</p></li>
<li><p><em>Academic users</em> may utilize the CVX Professional capability <em>at no charge</em>.
To do so, it is necessary to obtain licenses for Mosek and/or Gurobi
directly from the vendors.</p></li>
</ul>
<p>The bulk of CVX remains open source under a slightly modified version of the GPL Version
2 license. A small number of files that support the CVX Professional functionality remain
closed source. If those files are removed, the modified package remains <em>fully functional</em>
using the free solvers, SeDuMi and SDPT3. Users
may freely modify, augment, and redistribute this free version of CVX, as long as all
modifications are themselves released under the same license. This includes adding support
for new solvers released under a free software license such as the GPL.
For more details, please see the full <a class="reference internal" href="license.html#licensing2"><span class="std std-ref">Licensing</span></a> section.</p>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
        <p class="logo"><a href="index.html" title="index">
          <img class="logo" src="_static/cvxrlogo.png" alt="Logo"/>
        </a></p><div class="sphinx-toc sphinxlocaltoc">
    <h3><a href="index.html">Page contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">Introduction</a><ul>
<li><a class="reference internal" href="#what-is-cvx">What is CVX?</a><ul>
<li><a class="reference internal" href="#what-s-new">What’s new?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#what-is-disciplined-convex-programming">What is disciplined convex programming?</a><ul>
<li><a class="reference internal" href="#mixed-integer-problems">Mixed integer problems</a></li>
</ul>
</li>
<li><a class="reference internal" href="#what-cvx-is-not">What CVX is <em>not</em></a></li>
<li><a class="reference internal" href="#licensing">Licensing</a></li>
</ul>
</li>
</ul>

  </div>
  <div class="sphinxprev">
    <h4>Previous page</h4>
    <p class="topless"><a href="index.html"
                          title="Previous page">&larr; CVX Users’ Guide</a></p>
  </div>
  <div class="sphinxnext">
    <h4>Next page</h4>
    <p class="topless"><a href="install.html"
                          title="Next page">&rarr; Installation</a></p>
  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/intro.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div><h3>Other links</h3>
<ul class="this-page-menu">
<li><a href="CVX.pdf" target="_blank">Download the PDF</a></li>
<li><a href="http://cvxr.com/cvx">CVX home page</a></li>
</ul>


<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
    
    
        <div class="sidebar-toggle-group no-js">
            
            <button class="sidebar-toggle" id="sidebar-hide" title="Hide the sidebar menu">
                 «
                <span class="show-for-small">hide menu</span>
                
            </button>
            <button class="sidebar-toggle" id="sidebar-show" title="Show the sidebar menu">
                
                <span class="show-for-small">menu</span>
                <span class="hide-for-small">sidebar</span>
                 »
            </button>
        </div>
    
      <div class="clearer"></div>
    </div>
    <div class="relbar-bottom">
        
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="install.html" title="Installation"
             >next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="index.html" title="CVX Users’ Guide"
             >previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">CVX Users&#39; Guide</a> &#187;</li>

        <li class="nav-item nav-item-this"><a href="">Introduction</a></li> 
      </ul>
    </div>
    </div>

    <div class="footer" role="contentinfo">
        &#169; Copyright © 2012, CVX Research, Inc..
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.0.2.
    </div>
    <!-- cloud_sptheme 1.4 -->
  </body>
</html>